import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Message from './views/Message.vue'
import User from './views/User.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: '首页',
      meta: { level: 1 },
      component: Home
    },
    {
      path: '/message',
      name: '消息',
      meta: { level: 1 },
      component: Message
    },
    {
      path: '/user',
      name: '我的',
      meta: { level: 1 },
      component: User
    },
    {
      path: '/goods-list-all/:productName',
      name: '商品列表',
      meta: { level: 10 },
      component: () => import('./views/GoodsListHome.vue')
    },
    {
      path: '/goods-list/:className',
      name: '商品列表',
      meta: { level: 10 },
      component: () => import('./views/GoodsList.vue')
    },
    {
      path: '/goods-detail/:id',
      name: '商品详情',
      meta: { level: 20 },
      component: () => import('./views/GoodsDetail.vue')
    },
    {
      path: '/t-goods-detail',
      name: '推荐商品详情',
      meta: { level: 20 },
      component: () => import('./views/GoodsDetail2.vue')
    },
    {
      path: '/goods-detail-tuiguang',
      name: '推广商品详情',
      meta: { level: 20 },
      component: () => import('./views/GoodsDetail2.vue')
    },
    {
      path: '/order-list',
      name: '订单列表',
      meta: { level: 2 },
      component: () => import('./views/OrderList.vue')
    },
    {
      path: '/order-detail/:id',
      name: '订单详情',
      meta: { level: 8 },
      component: () => import('./views/OrderDetail.vue')
    },
    {
      path: '/message-detail/:id',
      name: '消息详情',
      meta: { level: 8 },
      component: () => import('./views/MessageDetail.vue')
    },
    {
      path: '/group-list',
      name: '拼团列表',
      meta: { level: 9 },
      component: () => import('./views/GroupList.vue')
    },
    {
      path: '/contrive',
      name: '我要推广',
      meta: { level: 3 },
      component: () => import('./views/Contrive.vue')
    },
    {
      path: '/open-group',
      name: '开团',
      meta: { level: 5 },
      component: () => import('./views/OpenGroup.vue')
    },
    {
      path: '/group/:id',
      name: '拼团',
      meta: { level: 30 },
      component: () => import('./views/Group.vue')
    },
    {
      path: '/my-group',
      name: '我的拼团',
      meta: { level: 4 },
      component: () => import('./views/MyGroup.vue')
    },
    {
      path: '/send',
      name: '推广',
      meta: { level: 4 },
      component: () => import('./views/Send.vue')
    },
    {
      path: '/apply',
      name: '申请推广员',
      meta: { level: 5 },
      component: () => import('./views/Apply.vue')
    },
    {
      path: '/over',
      name: '推广员订单',
      meta: { level: 5 },
      component: () => import('./views/Over.vue')
    },
    {
      path: '/share',
      name: '分享',
      meta: { level: 6 },
      component: () => import('./views/Share.vue')
    }
  ]
})
